//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    using_info  :"hide",
    scan_result :['hide','show'],
    error_info  : '请重新扫码或尝试其它共享球杆',
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
     var scan_result = wx.getStorageSync('scan_result') || '';
     console.log(scan_result);
     if(scan_result == ''){
       this.setData({
          scan_result : ['show','hide']
       })
     }else if(scan_result.status == 0){
       this.setData({
         scan_result : ['show', 'hide'],
         error_info  : scan_result.info+',请使用其它共享球杆'
       })
     }else{
         setTimeout(function () { wx.navigateBack(1); }, '300')
     }
  },
  
  backIndex:function(){
     wx.navigateBack(1);
  }

  // goWalletPage:function(){
  //     wx.navigateTo({  url: '/pages/wallet/wallet'})
  // },
  // goRedPacket:function(){
  //     wx.navigateTo({ url: '/pages/redpacket/redpacket' })
  // },
  // doScanCode:function(){
  //   wx.scanCode({
  //     success: (res) => {
      
  //     }
  //   })
  // }
})
